

package com.hazelcast.internal.metrics.impl;

import java.util.Collection;

/**
 * Utility functions for probes.
 */
class ProbeUtils {
    private ProbeUtils() {
    }

    static void flatten(final Class<?> clazz, final Collection<Class<?>> result) {
        result.add(clazz);

        if (clazz.getSuperclass() != null) {
            flatten(clazz.getSuperclass(), result);
        }

        for (final Class<?> interfaze : clazz.getInterfaces()) {
            result.add(interfaze);
            flatten(interfaze, result);
        }
    }
}
